<?php

namespace app\common\validate;

use think\Validate;

class Order extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'page|页码'                 => 'require',
        'pageCount|页面数量'        => 'require',
        'productId|商品ID'             => 'require',
        'productNum|商品数量'        => 'require',
        'productStyle|商品样式'            => 'require',
        'photoAddressId|拍照地址'  => 'require',
        'userSchoolId|学校地址'         => 'require',
        'userAddressId|收货地址'       => 'require',
        'status|职位'                  => 'require',
        'idCard|身份证号'           => 'require',
        'sex|性别'                  => 'require',
        'avatar|头像'               => 'require',
        'noticeId|消息编号'         => 'require',
        'content|投诉内容'          => 'require',
        'loginType|登录场景'        => 'require|in:1',
        'miniappLoginCode|微信Code' => 'require',
        'status|订单状态'                   => 'require|in:1,2,3,4,5',
        'orderSn|订单编号'                  => 'require'
    ];
    /**
     * 提示消息
     */
    protected $message = [
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'create'         => ['productId', 'productStyle','photoAddressId','userSchoolId','userAddressId'],
        'list'            => ['page', 'pageCount','status'],
        'orderDetail'      => ['orderSn'],
        'cancelOrder'       => ['orderSn'],
        'noticeDetail'     => ['noticeId'],
        'complaint'        => ['content'],
        'accountRetrieval' => ['mobile', 'captcha', 'passWord', 'confirmPassWord'],
        'scoreLog'         => ['page', 'pageCount'],
        'waitOrderPay'     => ['page', 'pageCount'],
    ];
}